package com.daiTest.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.daiTest.mapper.HeadlineMapper;
import com.daiTest.pojo.Headline;
import com.daiTest.pojo.Type;
import com.daiTest.pojo.vo.PortalVo;
import com.daiTest.service.TypeService;
import com.daiTest.mapper.TypeMapper;
import com.daiTest.untils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author Administrator
 * @description 针对表【news_type】的数据库操作Service实现
 * @createDate 2025-03-01 12:00:07
 */
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type>
        implements TypeService {

    /*查询新闻类别栏
     * 首先 获取数据库中所有信息*/
    @Autowired
    private TypeMapper typeMapper;

    @Autowired
    private HeadlineMapper headlineMapper;
    @Override
    public Result findAllTypes() {
        //查全部数据
        List<Type> types = typeMapper.selectList(null);
        //返回数据
        return Result.ok(types);
    }

}




